<template>
    <div>
        <el-bread></el-bread>
        <el-button class="btn" type="primary" size="small" plain @click="add">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-dialog ref="dialogInfo" @cancel="cancel" :isShow="isShow" :isAdd="isAdd"></v-dialog>
    </div>
</template>

<script lang="ts" setup>
import vList from './list.vue'
import vDialog from './dialog.vue'
import { ref } from 'vue';
let dialogInfo = ref()
const isShow = ref(false)
const isAdd = ref(true)
const add = () => {
    isShow.value = true
    isAdd.value = true
}
const cancel = (e: any) => {
    isShow.value = e
}

const edit = (e: any) => {
    isShow.value = true
    isAdd.value = false
    dialogInfo.value.lookup(e)
}
</script>

<style scope>
.btn {
    margin: 15px 0;
}
</style>